#ifndef _RETRO_DIALOG
#define _RETRO_DIALOG

#define RETRO_DIALOG_LEFTSIZE   75
#define RETRO_DIALOG_RIGHTSIZE  200
#define RETRO_DIALOG_BKCOLOR    0xFFFFFFFF

namespace Retro
{
  namespace Creator
  {
    namespace Dialog
    {
      class DialogBase : public Windows::Window
      {
      private:
        LayoutElement mLayout;
        HFONT         gdiFont;
        Gdip::Font    gdipFont;

      protected:
        virtual VOID  onCreate(Event::WndCreateEvent& iEvent);
        virtual VOID  onDestroy();
        virtual VOID  onEraseBackground(Event::EraseBackgroundEvent& iEvent);
        virtual VOID  onSize(Event::SizeEvent& iEvent);
        virtual VOID  onSizing(Event::SizingEvent& iEvent);
        virtual VOID  onShowWindow(Event::ShowWindowEvent& iEvent);

        virtual VOID  onLoad() = 0;
        virtual VOID  onUnload() = 0;

        INL LayoutElement&  getLayout()
        {
          return mLayout;
        }

        VOID  addSeparator(
          Separator &separator);

        VOID  addEdit(
          HWND        &hEdit,
          Label       &label,
          PCTSTR      text);

        LayoutElement*  addNumeric(
          HWND        &hUpDown,
          HWND        &hEdit,
          Label       &label,
          PCTSTR      text,
          INT         min,
          INT         max,
          INT         val);

        LayoutElement*  addPath(
          HWND        &hEdit,
          Label       &label,
          Button      &button,
          PCTSTR      text,
          UINT        id);

        LayoutElement*  addComboBox(
          HWND        &hCombo,
          Label       &label,
          PCTSTR      text);

        LayoutElement*  addOKCancel(
          Button      &btnOK,
          Button      &btnCancel,
          Separator   &separator);

        LayoutElement*  addOK(
          Button      &btnOK,
          Separator   &separator);

        INL VOID  doLayout()
        {
          mLayout.doLayout();
        }

      public:
        BOOL  create(
          LPCTSTR title,
          INT     width,
          HWND    owner,
          BOOL    sizeable = FALSE);

        INL HFONT       getGdiFont()  { return gdiFont; }
        INL Gdip::Font* getGdipFont() { return &gdipFont; }

        DialogBase();
        ~DialogBase();
      };
    } // namespace Dialog
  } // namespace Creator
} // namespace Retro

#endif